import express from "express"
const router = express.Router()
import {
  getProducts, 
  getProductById,
  delProductById,
  createProduct,
  updateProductById
} from "../controllers/product.js"
import { protect, admin } from "../middleware/auth.js"

router.route("/paging/list").get(getProducts)
router.route("/:id").get(getProductById).post(protect, admin, createProduct).delete(protect, admin, delProductById).put(protect, admin, updateProductById)

export default router